FROM hub.c.163.com/library/node:latest

EXPOSE 9000

HEALTHCHECK CMD curl -fs http://localhost:9000/healthz || exit 1

WORKDIR /opt/app
COPY package.json package-lock.json* ./
RUN npm install && npm cache clean --force && npm install -g forever
ENV PATH /opt/node_modules/.bin:$PATH

WORKDIR /opt/app/auth-server
COPY . /opt/app/auth-server

ENTRYPOINT [ "forever", "app.js" ]